package org.example.controller;


import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Map;

@RestController
@Slf4j
public class JenkinsController {
    @GetMapping("/")
    public Map<String,Object> test(){
        String stamp = LocalDateTime.now().toString();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("timestamp",System.currentTimeMillis());
        jsonObject.put("stamp",stamp);
        jsonObject.put("state","OK-------git jenkins simple docker");

        log.info("response:{}",jsonObject);
        return jsonObject;
    }

    @GetMapping("/test1")
    public Map<String,Object> test1(){
        String stamp = LocalDateTime.now().toString();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("timestamp",System.currentTimeMillis());
        jsonObject.put("state","test1------------test1");

        log.info("response:{}",jsonObject);
        return jsonObject;
    }
}
